
angular.module('mamApp').factory('paramsManager', ['$http', function ($http) {
  var paramsManager = {
   //组装params类型参数[1,2,3,4,5] 组装以后1/2/3/4/5
    //组装query{a:1,b:2}组装后?a=1&b=2
    params: function (params) {
      return params.join("/")
    },

    query: function (params) {
      var qString="";
      for(var i in params){
        if(params[i]){
          qString=qString+"&"+i+"="+params[i]
        }
      }
      return qString? "?" + qString.substring(1,qString.length) : "";
    }
  };

  return paramsManager;
}]);
